package com.chhlz.module.base.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="bill_table")
@DynamicUpdate(true)
@DynamicInsert(true)
public class BillTable implements java.io.Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -8335391851770802695L;
	private int id;
	private int billId;
	private int tableId;
	
	@Id
	@Column(name = "id",  nullable = false, length = 11)
	@GeneratedValue(generator = "generator") 
	@GenericGenerator(name = "generator", strategy = "increment") 
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name="bill_id")
	public int getBillId() {
		return billId;
	}
	public void setBillId(int billId) {
		this.billId = billId;
	}
	@Column(name="table_id")
	public int getTableId() {
		return tableId;
	}
	public void setTableId(int tableId) {
		this.tableId = tableId;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + billId;
		result = prime * result + tableId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BillTable other = (BillTable) obj;
		if (billId != other.billId)
			return false;
		if (tableId != other.tableId)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "BillTable [id=" + id + ", billId=" + billId + ", tableId="
				+ tableId + "]";
	}

}
